package cn.edu.nwsuaf.examcenter.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.edu.nwsuaf.examcenter.service.ExamItemService;

@Controller
@RequestMapping(value="/examItem")
public class ExamItemController {
	@Resource(name="examItemService")
	private ExamItemService examItemService;
	
	
	@RequestMapping(value="/loadExamItem")
	public String loadExamItem(@RequestParam(value="key",required=false)String key, @RequestParam(value="p",required=false)String p, ModelMap modelMap){
		examItemService.loadExamItem(modelMap);
		return "exam/exam-item-list";
	}
	
	@RequestMapping(value="/getExamItem/{examItemNo}")
	public String loadExamItem(@PathVariable("examItemNo")String examItemNo,ModelMap modelMap){
		examItemService.getExamItemInfo(examItemNo, modelMap);
		return "exam/exam-item-show";
	}
}
